<?
    use yii\widgets\LinkPager;
    use yii\helpers\Url;
    use yii\helpers\Html;
?>
<!-- main container -->
<div class="content">
    <div class="container-fluid">
        <div id="pad-wrapper" class="users-list">
            <div class="row-fluid header">
                <h3>管理员</h3>
                <div class="span9 pull-right">
                    <input type="text" class="span6 search" placeholder="Type a user's name..." />

                    <a href="<?=Url::to(['manager/add'])?>" class="btn-flat success pull-right">
                        <span>&#43;</span>
                        添加
                    </a>
                </div>
            </div>

            <!-- Users table -->
            <div class="row-fluid table">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th class="span2 sortable">
                            账号
                        </th>
                        <th class="span2 sortable">
                            <span class="line"></span>手机号
                        </th>
                        <th class="span2 sortable">
                            <span class="line"></span>邮箱
                        </th>
                        <th class="span2 sortable">
                            <span class="line"></span>登录时间
                        </th>
                        <th class="span2 sortable">
                            <span class="line"></span>登录IP
                        </th>
                        <th class="span2 sortable">
                            <span class="line"></span>操作
                        </th>
                    </tr>
                    </thead>
                    <tbody>
                    <!-- row -->
                    <? foreach ($data as $v):?>
                        <tr>
                            <td><?=$v->name?></td>
                            <td><?=$v->mobile?></td>
                            <td><?=$v->email?></td>
                            <td><?=$v->last_login_time?date('Y-m-d',$v->last_login_time):''?></td>
                            <td><?=$v->last_login_ip?long2ip($v->last_login_ip):''?></td>
                            <td>
                                <?= Html::a('编辑',  Url::to(['manager/edit','id'=>$v->id]),['class'=>'btn btn-xs']);?>
                                <?= Html::a('密码',  Url::to(['manager/password','id'=>$v->id]),['class'=>'btn btn-xs']);?>
                                <?= Html::a('删除',  Url::to(['manager/del','id'=>$v->id]),['class'=>'btn btn-danger btn-xs']);?>
                            </td>
                        </tr>
                    <? endforeach;?>
                    </tbody>
                </table>
            </div>
            <div class="pagination pull-right">
               <?=LinkPager::widget(['pagination' => $pagination]);?>
            </div>
            <!-- end users table -->
        </div>
    </div>
</div>
<!-- end main container -->

